home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / share / doc / bash-completion / contrib / sitecopy < prev    next >
Encoding:
Text File  |  2009-01-21  |  735 b   |  31 lines

  1. # sitecopy(1) completion
  2. # Copyright 2003 Eelco Lempsink <eelcolempsink@gmx.net>
  3. # License: GNU GPL v2 or later
  4. #
  5. # $Id: sitecopy,v 1.3 2005/01/03 02:44:22 ianmacd Exp $
  6.  
  7. _sitecopy()
  8. {
  9.     local cur
  10.  
  11.     COMPREPLY=()
  12.     cur=`_get_cword`
  13.  
  14.     case "$cur" in
  15.         --*)
  16.             COMPREPLY=( $( compgen -W "$(sitecopy -h | grep -e '--\w' | awk '{sub (/=(FILE|PATH)/, "", $2); print $2}')" -- $cur ) )
  17.         ;;
  18.         -*)
  19.             COMPREPLY=( $( compgen -W "$(sitecopy -h | grep -e '-\w' | awk '{sub (",", "", $1); print $1}')" -- $cur ) )
  20.         ;;
  21.         *)
  22.         if [ -r ~/.sitecopyrc ]; then
  23.             COMPREPLY=( $( compgen -W "$(grep '^["$'\t '"]*site'  ~/.sitecopyrc | awk '{print $2}')" -- $cur ) )
  24.         fi
  25.         ;;
  26.     esac
  27.  
  28.     return 0
  29. }
  30. complete -F _sitecopy -o default sitecopy
  31.